package com.aifund.common.dao;

import com.aifund.common.entity.Charge;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface ChargeDao extends JpaRepository<Charge,Long>, JpaSpecificationExecutor {


    /**
     * 分页查询充值列表
     * @param pageable
     * @return
     */
    @Override
    Page<Charge> findAll(Pageable pageable);

    /**
     * 分页查询充值列表可加条件
     * @param specification
     * @param pageable
     * @return
     */
    @Override
    Page findAll(Specification specification, Pageable pageable);

    /**
     * 根据充值ID获取充值对象
     * @param id
     * @return
     */
    Charge getById(Long id);

    /**
     * 根据hashCode（交易编码）获取充值实例
     * @param hashCode
     * @return
     */
    Charge getByHashCode(String hashCode);
}
